package com.medvalley.tcm.controller;

import com.medvalley.tcm.base.Result;
import com.medvalley.tcm.domain.Department;
import com.medvalley.tcm.service.DepartmentService;
import com.medvalley.tcm.vo.outputvo.DepartmentOutputVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author linsong
 * @date 2019/4/28 17:49
 **/
@RestController
@RequestMapping("/department")
@Api(value = "科室相关接口")
public class DepartmentController extends BaseController{

    @Autowired
    private DepartmentService departmentService;

    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public Result listDepartment() {
        List<DepartmentOutputVo> outputVos = departmentService.findAllDepartments();
        return success(outputVos);
    }

}
